JBoss Community Archive (Read Only)

PicketBox

Trusted Username

Introduction

This section describes how to authenticate users trusting only on the provided username. This mechanisms only checks if the user is stored at the configured Identity Store.

This authentication type is provided by the org.picketbox.core.authentication.impl.TrustedUsernameAuthenticationMechanism.

You do not need any specific configuration to use this mechanism, it is already configured when you start PicketBox.

Supported Credentials

This mechanism supports the following credential:

  • org.picketbox.core.authentication.credential.TrustedUsernameCredential

The code bellow demonstrates how to create this credential type.

String userName = "admin";

UserCredential credential = new TrustedUsernameCredential(userName);

Example

Trusted Username Authentication
PicketBoxManager picketBoxManager = createManager();

UserContext authenticatingUser = new UserContext();

UserCredential credential = new TrustedUsernameCredential("admin");

authenticatingUser.setCredential(credential);

// let's authenticate the user
UserContext authenticatedUser = picketBoxManager.authenticate(authenticatingUser);

assertNotNull(authenticatedUser);
assertTrue(authenticatedUser.isAuthenticated());
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:16:22 UTC, last content change 2012-11-01 20:50:45 UTC.